{% extends "admin/app_index.html" %}
{% load i18n %}

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}dashboard{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block content %}
<style>
#content-main {
    width: 762px;
}
</style>
<div id="content-main">
    {% load pagemagic_admin_tags %}
    <div class="module">
        <table style="width: 100%">
            <caption>Pagemagic</caption>
            {% show_admin_menu_branch %}
        </table>
    </div>
</div>
{% endblock %}

{% block sidebar %}
    {% if app_list %}
        <div id="content-related">
            {% for app in app_list %}
                {% ifnotequal app.name "Pagemagic" %}
                    <div class="module">
                        <table>
                            <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption>
                            {% for model in app.models %}
                                <tr>
                                    {% if model.perms.change %}
                                        <th scope="row" style="width: 100%"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
                                    {% else %}
                                        <th scope="row" style="width: 100%">{{ model.name }}</th>
                                    {% endif %}

                                    {% if model.perms.add %}
                                        <td><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Add' %}</a></td>
                                    {% else %}
                                        <td>&nbsp;</td>
                                    {% endif %}
                                </tr>
                            {% endfor %}
                        </table>
                    </div>
                {% endifnotequal %}
            {% endfor %}
        </div>
    {% else %}
        <p>{% trans "You don't have permission to edit anything." %}</p>
    {% endif %}
{% endblock %}
